#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
struct ST
{
	int id;
	char name[10];
	double sc;

};

void sc_camp(struct ST* p1, struct ST* p2)
{
	scanf("%d %lf", &p1->id, &p1->sc);
	gets_s(p1->name);
	scanf("%d %lf", &p2->id, &p2->sc);
	gets_s(p2->name);
	if (p1->sc > p2->sc)
	{
		printf("%10d %.1lf %10s\n", p1->id, p1->sc, p1->name);
	}
	else if (p1->sc < p2->sc)
	{
		printf("%10d %.1lf %10s\n", p2->id, p2->sc, p2->name);
	}
	else
	{
		printf("%10d %.1lf %10s\n", p1->id, p1->sc, p1->name);
		printf("%10d %.1lf %10s\n", p2->id, p2->sc, p2->name);
	}
}
int main()
{
	struct ST st1, st2;
	struct ST* p1 = &st1;
	struct ST* p2 = &st2;
	sc_camp(p1, p2);
	return 0;
}



